package org.ibase4j.provider.scheduler.pipeline;

import org.ibase4j.model.scheduler.GithubRepo;
import org.ibase4j.provider.sys.IGitHubRepoProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.PageModelPipeline;

/**
 * Created by admin on 2016-11-16.
 */

@Component("gitHubRepoDaoPipeline")
public class GitHubRepoDaoPipeline implements PageModelPipeline<GithubRepo> {

    @Autowired
    private IGitHubRepoProvider iGitHubRepoProvider;

    @Override
    public void process(GithubRepo githubRepo, Task task) {
        githubRepo.setCreateBy("system");
        githubRepo.setUpdateBy("system");
        githubRepo.setRemark("抓取");
        iGitHubRepoProvider.update(githubRepo);
    }
}
